home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 52
/
Amiga Format AFCD52 (Issue 136, May 2000).iso
/
-serious-
/
programming
/
basic
/
mildred
/
mildred.lha
/
lha
/
Mildred.lha
/
makedeflibs.ascii
next >
Wrap
Text File
|
1998-11-18
|
1KB
|
64 lines
DEFTYPE.l
WBStartup
;
;program to create a 'blitz2:deflibs' file based on 'blitzlibs:#?/' libs
;
If WriteFile(0,"blitz2:deflibs")=0
NPrint "Error creating blitz2:deflibs":End
EndIf
;
l.l=Lock_("blitzlibs:",-2)
If l=0
NPrint "Error 'locking' blitzlibs:":End
EndIf
;
e.l=AllocMem_(260,1)
e2.l=AllocMem_(260,1)
;
Examine_ l,e
;
While ExNext_(l,e)
If Peek.l(e+4)>=0 ;dir ?
d$="blitzlibs:"+Peek$(e+8)
l2=Lock_(&d$,-2)
If l2=0
NPrint "Error 'locking' ",d$:UnLock_ l:CloseFile 0:KillFile "blitz2:deflibs"
Goto freemem
EndIf
NPrint "":NPrint "Scanning directory : ",d$:NPrint ""
Examine_ l2,e2
While ExNext_(l2,e2)
If Peek.l(e2+4)<0 ;file?
f$=LCase$(Peek$(e2+8))
If Right$(f$,5)<>".info"
f$=d$+"/"+f$
If ReadFile(1,f$)
NPrint "Converting library : ",f$
FileInput 1:FileOutput 0
Print Mkl$(Lof(1))
; Print Inkey$(Lof(1))
InitBank 0,Lof(1),1
ReadMem 1,Bank(0),Lof(1)
WriteMem 0,Bank(0),Lof(1)
CloseFile 1:DefaultOutput
Else
NPrint "Error reading file ",f$
UnLock_ l:UnLock_ l2:CloseFile 0:KillFile "blitz2:deflibs"
Goto freemem
EndIf
EndIf
EndIf
Wend
UnLock_ l2
EndIf
Wend
FileOutput 0:Print Mkl$(0):DefaultOutput
UnLock_ l
CloseFile 0
freemem:FreeMem_ e,260:FreeMem_ e2,260
End